From 551a7120e2c3732a9152b344df3da43dbeece0a2 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 11 Mar 2004 15:07:45 +0000 Subject: [PATCH] Misc boring code cleanups. There shouldn't be visible changes here. --- gpsbabel/Makefile | 4 ++-- gpsbabel/defs.h | 3 +++ gpsbabel/garmin.c | 2 +- gpsbabel/gpx.c | 8 ++++---- gpsbabel/pcx.c | 2 +- gpsbabel/smplrout.c | 2 -- gpsbabel/tpg.c | 1 + gpsbabel/util.c | 3 +++ gpsbabel/vecs.c | 1 + 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/gpsbabel/Makefile b/gpsbabel/Makefile index ab21c9151..26e9ecdae 100644 --- a/gpsbabel/Makefile +++ b/gpsbabel/Makefile @@ -78,8 +78,8 @@ dep: (echo -n "internal_styles.c: mkstyle.sh " ; echo style/*.style ; /bin/echo -e '\t./mkstyle.sh > $@ || (rm -f $@ ; exit 1)' ) >> /tmp/dep echo Edit Makefile and bring in /tmp/dep -VERSIONU=1_2_2_beta02222004 -VERSIOND=1.2.2_beta02222004 +VERSIONU=1_2_2_beta03112004 +VERSIOND=1.2.2_beta03112004 #VERSIONU=1_2_1 #VERSIOND=1.2.1 diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index c78a7b56e..ffedceb68 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -243,11 +243,13 @@ void route_del_wpt(route_head *rte, waypoint *wpt); void route_add_head(route_head *rte); void track_add_head(route_head *rte); void route_disp_all(route_hdr, route_trl, waypt_cb); +void track_disp_all(route_hdr, route_trl, waypt_cb); void route_free (route_head *); void route_flush( queue *); void route_flush_all(void); unsigned int route_waypt_count(void); unsigned int route_count(void); +unsigned int track_count(void); /* * All shortname functions take a shortname handle as the first arg. @@ -403,6 +405,7 @@ int case_ignore_strcmp(const char *s1, const char *s2); char *strsub(char *s, char *search, char *replace); void rtrim(char *s); signed int get_tz_offset(void); +signed int month_lookup(const char *m); const char *get_cache_icon(const waypoint *waypointp); char * xml_entitize(const char * str); char * strip_html(const utf_string*); diff --git a/gpsbabel/garmin.c b/gpsbabel/garmin.c index 34babd697..e8b32bdf9 100644 --- a/gpsbabel/garmin.c +++ b/gpsbabel/garmin.c @@ -258,7 +258,7 @@ route_read(void) nroutepts = GPS_Command_Get_Route(portname, &array); - fprintf(stderr, "Routes %d\n", nroutepts); + fprintf(stderr, "Routes %d\n", (int) nroutepts); #if 1 for (i = 0; i < nroutepts; i++) { route_head *rte_head; diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index f71bd0a70..144c41825 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -435,6 +435,8 @@ gpx_start(void *data, const char *el, const char **attr) case tt_cache_desc_short: tag_cache_desc(attr); break; + default: + break; } if (passthrough) { start_something_else(el, attr); @@ -711,6 +713,8 @@ gpx_end(void *data, const char *el) end_something_else(); *s = 0; return; + default: + break; } if (passthrough) @@ -1087,8 +1091,6 @@ gpx_waypt_pr(const waypoint *waypointp) static void gpx_track_hdr(const route_head *rte) { - char * tmp_ent; - fprintf(ofd, "\n"); write_optional_xml_entity(ofd, " ", "name", rte->rte_name); write_optional_xml_entity(ofd, " ", "desc", rte->rte_desc); @@ -1130,8 +1132,6 @@ void gpx_track_pr() static void gpx_route_hdr(const route_head *rte) { - char * tmp_ent; - fprintf(ofd, "\n"); write_optional_xml_entity(ofd, " ", "name", rte->rte_name); write_optional_xml_entity(ofd, " ", "desc", rte->rte_desc); diff --git a/gpsbabel/pcx.c b/gpsbabel/pcx.c index 5d2000e9c..07b4d9566 100644 --- a/gpsbabel/pcx.c +++ b/gpsbabel/pcx.c @@ -76,7 +76,7 @@ data_read(void) waypoint *wpt_tmp; char ibuf[122]; struct tm tm; - route_head *track_head; + route_head *track_head = NULL; for(;fgets(ibuf, sizeof(ibuf), file_in);) { switch (ibuf[0]) { diff --git a/gpsbabel/smplrout.c b/gpsbabel/smplrout.c index 401317798..ee24fa3f7 100644 --- a/gpsbabel/smplrout.c +++ b/gpsbabel/smplrout.c @@ -223,8 +223,6 @@ routesimple_process( void ) void routesimple_init(const char *args) { - char *fm; - count = 0; if (countopt) { diff --git a/gpsbabel/tpg.c b/gpsbabel/tpg.c index d62a43647..d9eb11c7c 100644 --- a/gpsbabel/tpg.c +++ b/gpsbabel/tpg.c @@ -21,6 +21,7 @@ */ #include "defs.h" +#include #include "jeeps/gpsmath.h" /* for datum conversions */ #define MYNAME "TPG" diff --git a/gpsbabel/util.c b/gpsbabel/util.c index a50d9825d..4df42e887 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -449,6 +449,9 @@ get_tz_offset(void) } } +/* + * Return the (zero based) month number of the year or -1 for failure. + */ signed int month_lookup(const char *m) { diff --git a/gpsbabel/vecs.c b/gpsbabel/vecs.c index 304dda908..46a1fa714 100644 --- a/gpsbabel/vecs.c +++ b/gpsbabel/vecs.c @@ -415,6 +415,7 @@ disp_vecs(void) * Additional information for V1. * Output format type at front of line. */ +static void disp_v1(ff_type t) { char *tstring; -- 2.30.2